package com.ehome.emergency.entities;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * BasicFramework
 *
 * @author: haoxiaolei
 * @date: 2016-04-01 16:30
 * @desc: 账号
 */
@Entity
@Table(name = "share_account")
@DynamicInsert
@DynamicUpdate
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "com.ehome.emergency.entities.Account")
public class Account implements Serializable {
    private static final long serialVersionUID = 7476004191286678718L;

    //成员变量**********************************************************************
    /**
     * 主键
     */
    @Id
    @GenericGenerator(name = "share_account_id_generator", strategy = "native")
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    /**
     * 账号名称
     */
    @Column(name = "acc_name", length = 20, nullable = false)
    private String accName;
    /**
     * 账号密码
     */
    @Column(name = "acc_password", length = 20, nullable = false)
    private String password;
    /**
     * 姓名
     */
    @Column(name = "name", length = 15)
    private String name;
    /**
     * 昵称
     */
    @Column(name = "nick_name", length = 60)
    private String nickName;
    /**
     * 手机号
     */
    @Column(name = "phone", length = 11)
    private String phone;
    /**
     * 功能描述
     */
    @Column(name = "description")
    private String description;
    /**
     * 租户Id.
     */
    @Column(name = "tenantId", length = 15)
    private String tenantId;
    /**
     * 状态:  AVAILABLE  可用
     *       UNAVAILABLE  不可用
     */
    @Column(name = "status", length = 18, nullable = false)
    private String status;
    /**
     * 所属机构Id
     */
    @Column(name = "org_id")
    private Long orgId;


    //setter/getter****************************************************************
    public Long getId() {
        return id;
    }

    public String getAccName() {
        return accName;
    }

    public String getPassword() {
        return password;
    }

    public String getNickName() {
        return nickName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public String getDescription() {
        return description;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public void setAccName(String accName) {
        this.accName = accName;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Long getOrgId() {
        return orgId;
    }

    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }
}
